<template>
  <div>
    <el-container>
      <el-aside :width="asideWith" style="min-height: 100vh; background-color: #001529">
        <div style="height: 60px; color: white; display:flex; align-items: center; justify-content: center" >
          <img src="@/assets/logo.png" alt="" style="width: 40px; height: 40px">
        </div>
        <el-menu :collapse="isCollapse" :collapse-transition="false" router background-color="#001529" text-color="rgba(255,255,255,0.65)" active-text-color="#fff" style="border: none" :default-active="$route.path">
          <el-menu-item index="/">
            <i class="el-icon-s-home"></i>
            <span slot="title">系统首页</span>
          </el-menu-item>
          <el-menu-item index="/m2">
            <i class="el-icon-s-home"></i>
            <span slot="title">系统首页</span>
          </el-menu-item>
          <el-menu-item index="/2">
            <i class="el-icon-s-home"></i>
            <span slot="title">系统首页</span>
          </el-menu-item>
          <el-menu-item index="/3">
            <template slot="title">
              <i class="el-icon-menu"></i>
              <span>系统首页</span>
            </template>
          </el-menu-item>
            <el-submenu>
              <template slot="title">
                <i class="el-icon-menu"></i>
                <span>m5</span>
              </template>
              <el-menu-item>sm1</el-menu-item>
              <el-menu-item>sm2</el-menu-item>
            </el-submenu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header>
          <i class="el-icon-menu" style="width: 40px; margin-top: 10px" @click="handleCollapse"></i>
        </el-header>
        <el-main>
          main
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>


export default {
  name: 'HomeView',
  data() {
    return {
      isCollapse: false,
      asideWith: '200px',
    }
  },
  methods: {
    handleCollapse(){
      this.isCollapse = !this.isCollapse
      this.asideWith = this.isCollapse ? '60px' : '200px'
    }
  }
}
</script>

<style>
.el-menu--inline {
  background-color: #000c17 !important;
}
.el-menu--inline .el-menu-item {
  background-color: #000c17 !important;
  padding-left: 49px !important;
}
.el-menu-item:hover, .el-submenu__title:hover i, .el-submenu__title:hover{
  color: #fff !important;
}
.el-menu-item.is-active {
  background-color: #40a9ff !important;
  border-radius: 10px;
  width: calc(100% - 8px);
  margin-left: 4px;
  margin-right: 4px;
  min-width: 0;
}

.el-menu-item.is-active i, .el-menu-item.is-active .el-tooltip{
  margin-left: -4px;
  min-width: 0;
}

.el-menu-item {
  height: 40px;
  line-height: 40px;
}
.el-submenu__title {
  height: 40px;
  line-height: 40px;
}

.el-submenu .el-menu-item {
  min-width: 0;
}

.el-menu--inline .el-menu--inline.is-active {
  padding-left: 45px;
}
</style>
